package com.paomi.client.activity.newsDetail;

import com.hannesdorfmann.mosby3.mvp.MvpBasePresenter;
import com.paomi.client.activity.newsDetail.model.NewsBean;
import com.paomi.client.net.Api;
import com.paomi.client.net.BaseCallback;
import com.paomi.client.net.Constants;
import com.paomi.client.view.LoadingDialog;

import retrofit2.Call;

/**
 * Created by pc on 2018/11/23
 * Describe:
 * com.paomi.client.activity.newsDetail
 */
public class NewsDetailPresenter extends MvpBasePresenter<NewsMvpView> {
    /**
     * 请求详情
     * @param id
     */
    public void setDetailNew(String id){
        LoadingDialog.get().showLoading();
        Api.getInstanceService(Constants.Ticket_URL).getDetailNew(id).enqueue(new BaseCallback<NewsBean>() {
            @Override
            public void onResponse(Call<NewsBean> call, NewsBean result) {
                getView().setDetailData(result);
                LoadingDialog.get().hideLoading();
            }
        });
    }
}
